/*
 * ViewEssayForm.java
 *
 * Created on __DATE__, __TIME__
 */

package com.example.essayGUI;

import com.example.essayRes.Essay;

/**
 *
 * @author  __USER__
 */
public class ViewEssayForm extends javax.swing.JFrame {

	javax.swing.JFrame parentForm = null;
	Essay theEssay = null;

	/** Creates new form ViewEssayForm */
	public ViewEssayForm(javax.swing.JFrame parent, Essay newEssay) {
		parentForm = parent;
		theEssay = newEssay;
		initComponents();
	}

	//	public ViewEssayForm(AuthorForm parent){
	//		parentForm=parent;
	//		initComponents();
	//	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jScrollPane2 = new javax.swing.JScrollPane();
		jEditorPane1 = new javax.swing.JEditorPane();
		jScrollPane1 = new javax.swing.JScrollPane();
		jEditorPane2 = new javax.swing.JEditorPane();
		jButton1 = new javax.swing.JButton();
		essayTitle = new javax.swing.JLabel();
		essayInfo = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jScrollPane2.setViewportView(jEditorPane1);

		jEditorPane2.setEditable(false);
		jScrollPane1.setViewportView(jEditorPane2);

		jButton1.setText("\u786e\u5b9a");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addGroup(
																						layout.createSequentialGroup()
																								.addGap(62,
																										62,
																										62)
																								.addComponent(
																										jScrollPane1,
																										javax.swing.GroupLayout.PREFERRED_SIZE,
																										758,
																										javax.swing.GroupLayout.PREFERRED_SIZE)
																								.addPreferredGap(
																										javax.swing.LayoutStyle.ComponentPlacement.RELATED))
																				.addGroup(
																						javax.swing.GroupLayout.Alignment.TRAILING,
																						layout.createSequentialGroup()
																								.addContainerGap(
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										Short.MAX_VALUE)
																								.addComponent(
																										jButton1)
																								.addGap(366,
																										366,
																										366)))
																.addComponent(
																		jScrollPane2,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		0,
																		javax.swing.GroupLayout.PREFERRED_SIZE))
												.addGroup(
														layout.createSequentialGroup()
																.addGap(134,
																		134,
																		134)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.TRAILING,
																				false)
																				.addComponent(
																						essayInfo,
																						javax.swing.GroupLayout.Alignment.LEADING,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						essayTitle,
																						javax.swing.GroupLayout.Alignment.LEADING,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						584,
																						Short.MAX_VALUE))))
								.addContainerGap(46, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addGap(303,
																		303,
																		303)
																.addComponent(
																		jScrollPane2,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		239,
																		Short.MAX_VALUE))
												.addGroup(
														javax.swing.GroupLayout.Alignment.TRAILING,
														layout.createSequentialGroup()
																.addGap(29, 29,
																		29)
																.addComponent(
																		essayTitle,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		18,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addGap(18, 18,
																		18)
																.addComponent(
																		essayInfo,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		21,
																		Short.MAX_VALUE)
																.addGap(32, 32,
																		32)
																.addComponent(
																		jScrollPane1,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		375,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addGap(26, 26,
																		26)
																.addComponent(
																		jButton1)))
								.addContainerGap()));

		java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit()
				.getScreenSize();
		setBounds((screenSize.width - 880) / 2, (screenSize.height - 586) / 2,
				880, 586);
	}// </editor-fold>
	//GEN-END:initComponents

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
		this.parentForm.setEnabled(true);
		this.dispose();
	}

	/**
	 * @param args the command line arguments
	 */
	/*
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new ViewEssayForm().setVisible(true);
			}
		});
	}
	 */

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JLabel essayInfo;
	private javax.swing.JLabel essayTitle;
	private javax.swing.JButton jButton1;
	private javax.swing.JEditorPane jEditorPane1;
	private javax.swing.JEditorPane jEditorPane2;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane2;
	// End of variables declaration//GEN-END:variables

}